import { Lua } from './lua_generator';

export const inout_print = function () {
    var str = Lua.valueToCode(this, 'VAR', Lua.ORDER_ATOMIC) || '""';
    var code = "print(" + str + ")\n";
    return code;
};

export const inout_print_many = function () {
    var code = new Array(this.itemCount_);
    var default_value = '0';
    for (var n = 0; n < this.itemCount_; n++) {
        code[n] = Lua.valueToCode(this, 'ADD' + n,
            Lua.ORDER_NONE) || default_value;
    }
    return 'print(' + code.join(', ') + ')\n';
};